#!/bin/sh
X_CURSORS_DIR="./x-cursors/"
X_IN_DIR="."
X_CURSORS_DIR="$(readlink -m ${X_CURSORS_DIR})"
X_IN_DIR="$(readlink -m ${X_IN_DIR})"
if [ -e ${X_CURSORS_DIR} ] && [ ! -d  ${X_CURSORS_DIR} ]; then
	echo "$(basename ${0}):error: File ${X_CURSORS_DIR} exists and is not directory!"
	exit -1
else
	if [ ! -e ${X_CURSORS_DIR} ]; then
		mkdir -pv ${X_CURSORS_DIR}
	fi
fi
for f in ${X_IN_DIR}/*.in; do
	[ -r ${f} ]  \
	&& echo "xcursorgen ${f} ${X_CURSORS_DIR}/$(basename -s '.in' ${f})" \
	&& xcursorgen ${f} ${X_CURSORS_DIR}/$(basename -s '.in' ${f})
done
exit 0
